package rad.framework.mda.generator.template.conf;

import rad.framework.mda.generator.util.*;

public class HsqldbDS
{
  protected static String nl;
  public static synchronized HsqldbDS create(String lineSeparator)
  {
    nl = lineSeparator;
    HsqldbDS result = new HsqldbDS();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + NL + "<datasources>" + NL + "  <local-tx-datasource>" + NL + "    <jndi-name>";
  protected final String TEXT_2 = "DS</jndi-name>" + NL + "    <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}";
  protected final String TEXT_3 = "${/}hypersonic${/}database</connection-url>" + NL + "    <driver-class>org.hsqldb.jdbcDriver</driver-class>" + NL + "    <user-name>sa</user-name>" + NL + "    <password><![CDATA[]]></password>" + NL + "  </local-tx-datasource>" + NL + "</datasources>";
  protected final String TEXT_4 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    

    org.eclipse.uml2.uml.Model uml2Model = (org.eclipse.uml2.uml.Model) argument;
    stringBuffer.append(TEXT_1);
    stringBuffer.append(NameHelper.getCapName(uml2Model));
    stringBuffer.append(TEXT_2);
    stringBuffer.append(uml2Model.getName());
    stringBuffer.append(TEXT_3);
    stringBuffer.append(TEXT_4);
    return stringBuffer.toString();
  }
}
